package com.moran.beetlsql.module.service;

import com.moran.beetlsql.module.entity.SysLog;
import com.moran.beetlsql.module.entity.SysUser;
import com.moran.beetlsql.module.mapper.main.MainUserMapper;
import com.moran.beetlsql.module.mapper.sub.SubUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author wnf
 * @Date 2025-03-17
 */
@Service
public class UserService {

    @Autowired
    private SubUserMapper subUserMapper;

    @Autowired
    private MainUserMapper mainUserMapper;

    public Map<String, Object> queryAllUserList() {
        Map<String, Object> map = new HashMap<>();
        System.out.println("------main------");
        List<SysUser> mainList = mainUserMapper.queryAllUserList();
        map.put("main", mainList);
        System.out.println("------sub------");
        List<SysUser> subList = subUserMapper.queryAllUser();
        map.put("sub", subList);
        return map;
    }

    public Map<String, Object> queryAllLogList() {
        Map<String, Object> map = new HashMap<>();
        System.out.println("------main------");
        List<SysLog> mainList = mainUserMapper.queryAllLogList();
        map.put("main", mainList);
        System.out.println("------sub------");
        List<SysLog> subList = subUserMapper.queryAllLogList();
        map.put("sub", subList);
        return map;
    }
}
